<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="/WEB-INF/tld/showUpsAndWeight.tld" prefix="uw" %>  
<%@ taglib uri="/WEB-INF/tld/waybillStatus.tld" prefix="ws" %> 
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>运单详情</title>
		<link rel="stylesheet" type="text/css" href="btn_class.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/resources/css/ext-all.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/style.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/desktop.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/ext-patch.css" />

		<script type="text/javascript" src="ext-2.2/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="ext-2.2/ext-all.js"></script>
		<script type="text/javascript" src="js/cal.js"></script>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<script type="text/javascript">
		<%String uId = (String) session.getAttribute("Uid");
			if (uId == null || uId.equals("null")) {%>
			window.parent.location.href = 'index.jsp';
		<%}%>
	</script>
	<style type="text/css">
		
		.btnSubmit
		{
			padding-bottom : 0px;
			margin : 0px;
			padding-left : 0px;
			padding-right : 0px;
			font-family : "宋体", Arial, Helvetica, sans-serif;
			font-size : 12px;
			padding-top : 0px;
			height : 18px;
		}
		.bd1
		{
			width : 200px;
			float : left;
			height : 20px;
		}
		div
		{
			padding-bottom : 0px;
			margin : 0px;
			padding-left : 0px;
			padding-right : 0px;
			font-family : "宋体", Arial, Helvetica, sans-serif;
			font-size : 12px;
			padding-top : 0px;
			
		}
		.right_center
		{
			background : white;
			padding-bottom: 50px;
			padding-left: 30px;
			width : 100%;
			padding-right: 0px;
			padding-top: 28px;
		}
		.wenzi
		{
			text-align : right;
			line-hight :20 px;
			width :102px;
			padding-right :10px;
			float : left;
			height :20 px;
		}
		.wenzi2
		{
			line-hight :20 px;
			width :300px;
			padding-left :40px;
			float : left;
			height :20 px;
		}
		
		.wwhh
		{
			padding-bottom : 10px;
			line-height : 14px;
			padding-left : 110px;
			width : 1000px;
			padding-right : 0px;
			color : #a9a9a9;
			padding-top : 0px;
		}
		
	</style>
	<script type="text/javascript">
		function managerApprovalWaybill(wbId){
			var wbStatus = document.getElementById("wbStatus").value;
			if(wbStatus == ""){
				alert("请更改订单状态!");
				return;
			}
				var vFlag = false;
				var len = document.getElementById("wbLength").value;
				var wid = document.getElementById("wbWidth").value;
				var hei = document.getElementById("wbHeight").value;
				if(len==""&&wid==""&&hei==""){
					vFlag = true
				}
				if(len!=""&&wid!=""&&hei!=""){
					vFlag = true
				}  
				if(!vFlag){
					alert("请同时输入长宽高或者都不输入！");
					return;
				}
				
				if(len!=""&&wid!=""&&hei!=""){
					var vEnterWeight = fomatFloat(document.getElementById("wbEnterWeight").value,2);
					var vWeight = fomatFloat(FloatDiv(fomatFloat(FloatMul(fomatFloat(FloatMul(len,wid),2),hei),2),166),2);
					if(vWeight>vEnterWeight){
						alert("对不起，体积重量是"+vWeight+",大于物理重量"+vEnterWeight+",请修改重量!");
						return;
					}
				}
			
			var f = document.forms["wbApprovalForm"];
			f.action = "waybill!managerApprovalAWaybill.do?wbId="+wbId+"&flag=forecast";
			f.submit(); 
		}
		
		function deleteWaybill(wbId){
			var flag = window.confirm("确定要删除吗?");  
			if(!flag) return; 
			var f = document.forms["wbApprovalForm"];
			f.action = "waybill!deleteWaybillById.do?wbId="+wbId;
			f.submit(); 
		}
		
	</script>
	</head>


<body class="ext-ie ext-ie6 ext-border-box " id="ext-gen6">
<div class="x-panel x-panel-noborder x-form-label-right" id="ext-comp-1001" style="width: 100%;">
	<div class="x-panel-header x-panel-header-noborder x-unselectable" id="ext-gen8" style="mozuserselect: none; khtmluserselect: none;" unselectable="on">
		<span class="x-panel-header-text" id="ext-gen21">运单详情</span>
	</div>
	 <form name="wbApprovalForm" method="post">
	 	<s:iterator id="wb" value="wbTO">
		<div class="right_center">
		<div style="height:20px;align:center;  background: #eff5fb; color: #1e5494; font-size: 15px; font-weight: bold; border: #7db5de 1px solid;" >运单信息：</div>
		<br/>
		
			<div style="height:26px">
				<div class="wenzi">订单编号：</div>
				<div class="wenzi2"><s:property value="#wb.wbId"/></div>
			</div>
			
			<div style="height:26px">
				<div class="wenzi">仓库：</div>
				<div class="wenzi2"><s:property value="#wb.wbArea"/></div>
			</div>
			
			<div style="height:26px">
				<div class="wenzi">当前订单状态：</div>
				<div class="wenzi2"><ws:translateStatus enStatus="${wb.wbStatus}"></ws:translateStatus></div>
			</div>
			
				<div style="height:26px">
				<div class="wenzi">Ups号：</div>
				<input name="wbUps" id="wbUps" class="bd1" type="text" size="18" value="<s:property value='#wb.wbUps'/>"/>
			</div>
			
				<div style="height:26px">
				<div class="wenzi">重量Lbs：</div>
				<input name="wbEnterWeight" id="wbEnterWeight" class="bd1" type="text" size="18" value="<s:property value='#wb.wbEnterWeight'/>"/>
			</div>
			
			<div style="height:26px">
				<div class="wenzi">更改状态：</div>
				<select name="wbStatus"  class="bd1">
  						<option value=""></option>
  						<option value="enterStatus">入库</option>
				</select><font color="#ff0000">*</font>
			</div>
				<div style="height:26px">
				<div class="wenzi">长：</div>
				<input  id="wbLength" class="bd1" type="text" size="18" />
			</div>
				<div style="height:26px">
				<div class="wenzi">宽：</div>
				<input id="wbWidth" class="bd1" type="text" size="18"/>
			</div>
				<div style="height:26px">
				<div class="wenzi">高：</div>
				<input  id="wbHeight" class="bd1" type="text" size="18"/>
			</div>
			<div style="height:26px">
				<div class="wenzi">到货预报日期：</div>
				<div class="wenzi2"><s:property value="#wb.wbForecastStatusTime"/></div>
			</div>
			
			<br/>
			<div style="height:26px">
				<div class="wenzi"></div>
				<div class="wenzi2">
					<input type="button" value="入库" class="btnSubmit" onclick="managerApprovalWaybill('${wb.wbId}')" />&nbsp;&nbsp;&nbsp;
					<input type="button" value="删除" class="btnSubmit" onclick="deleteWaybill('${wb.wbId}')" />
				</div>
			</div>
		</div>
		</s:iterator>
		
	</form>
</div>
</body>
</html>
